package cn.edu.wzu.openlearning.pojo;

import java.util.Objects;

public class Word {
    private Integer wordId;
    private String word;// 单词本身
    private String englishPronunciation;// 英音
    private String americaPronunciation;// 美音
    private String meaning; // 单词的意思

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Word word1 = (Word) o;
        return word.equals(word1.word);
    }

    @Override
    public int hashCode() {
        return Objects.hash(word);
    }

    public Word() {}

    public Word(Integer wordId) {
        this.wordId = wordId;
    }

    public Word(Integer wordId, String word, String englishPronunciation, String americaPronunciation, String meaning) {
        this.wordId = wordId;
        this.word = word;
        this.englishPronunciation = englishPronunciation;
        this.americaPronunciation = americaPronunciation;
        this.meaning = meaning;
    }

    @Override
    public String toString() {
        return "EnglishWord{" +
                "wordId=" + wordId +
                ", word='" + word + '\'' +
                ", englishPronunciation='" + englishPronunciation + '\'' +
                ", americaPronunciation='" + americaPronunciation + '\'' +
                ", meaning='" + meaning + '\'' +
                '}';
    }

    public Integer getWordId() {
        return wordId;
    }

    public void setWordId(Integer wordId) {
        this.wordId = wordId;
    }

    public String getWord() {
        return word;
    }

    public void setWord(String word) {
        this.word = word;
    }

    public String getEnglishPronunciation() {
        return englishPronunciation;
    }

    public void setEnglishPronunciation(String englishPronunciation) {
        this.englishPronunciation = englishPronunciation;
    }

    public String getAmericaPronunciation() {
        return americaPronunciation;
    }

    public void setAmericaPronunciation(String americaPronunciation) {
        this.americaPronunciation = americaPronunciation;
    }

    public String getMeaning() {
        return meaning;
    }

    public void setMeaning(String meaning) {
        this.meaning = meaning;
    }
}
